<template>
    <share-grid :content="buildContent"/>
</template>

<script>
import { ShareGrid } from "../../packages/index"

function buildContent(){
    return [
        {
            label: "定位时间",
            value: "2024-03-01 14:03:08",
        },
        {
            label: "状态",
            name:"status",
            // value: "1",
            pipeline: (value) => {
                // 1: 行驶; 3:停车 2离线
                switch (value) {
                    case '1': {
                        return "行驶"
                    }
                    case '2': {
                        return "离线"
                    }
                    case '3': {
                        return "停车"
                    }
                    default: {
                        return "-"
                    }
                }
            },
            span: 8
        },
        {
            label: "OBD设备状态",
            value: "1",
            pipeline: (value) => {
                return value == 0 ? "未点亮" : "点亮"
            },
            span: 8
        },
        {
            label: "总里程",
            value: "6375.16375.16375.16375.16375.16375.16375.16375.16375.1",
            unit: "km",
            span: 8,
        },
        {
            label: "当前车速",
            value: "75",
            unit: "km/h",
            span: 12,
        },
        {
            label: "总油耗",
            value: "3253",
            unit: "L",
            span: 12,
        },
        {
            label: "百公里油耗",
            value: "51.03",
            unit: "L/100km",
            span: 12,
        },
        {
            label: "地址",
            value: "云南省文山壮族苗族自治州广南县八宝镇八宝服务区(广昆高速广州方向)云南省文山壮族苗族自治州广南县八宝镇八宝服务区(广昆高速广州方向)云南省文山壮族苗族自治州广南县八宝镇八宝服务区(广昆高速广州方向)",
            labelStyle:{
                color:"red"
            }
        }
    ]
}

export default {
    name:"Grid",
    components:{
        ShareGrid
    },
    computed:{
        buildContent
    },
    methods:{
    }
}
</script>

<style>

</style>